<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
	<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
	<title>获取数组中的最大值</title>
	<script type="text/javascript">
		function getMax(arr){
			var max = arr[0];
			for(var i=1;i<arr.length;i++){
				if(arr[i]>max){
					max=arr[i];
				}
			}
			return max;
		}
		var arr = [1,56,23,6,43,87,3,5,55];
		//var res = getMax(arr)
		document.write(getMax(arr));
	</script>
</head>
<body>
	
</body>
</html>